vm_event: sanitize vm_event response handling
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Mon, 19 Sep 2016 09:38:08 +0000 (11:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 19 Sep 2016 09:38:08 +0000 (11:38 +0200)
commit1c637370b504d3f5d3c8bcbcf74f6b5efa6d79d1
treedec9aa9269f37ff1fb6a547a761d281f895efa0f
parentb982a5bea4273a4b9fc007d5046bed8d1669c07f
vm_event: sanitize vm_event response handling

Setting response flags in vm_event are only ever safe if the vCPUs are paused.
To reflect this we move all checks within the if block that already checks
whether this is the case. Checks that are only supported on one architecture
we relocate the bitmask operations to the arch-specific handlers to avoid
the overhead on architectures that don't support it.

Furthermore, we clean-up the emulation checks so it more clearly represents the
decision-logic when emulation should take place. As part of this we also
set the stage to allow emulation in response to other types of events, not just
mem_access violations.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
xen/arch/x86/mm/p2m.c
xen/arch/x86/vm_event.c
xen/common/vm_event.c
xen/include/asm-arm/p2m.h
xen/include/asm-arm/vm_event.h
xen/include/asm-x86/p2m.h
xen/include/asm-x86/vm_event.h
xen/include/xen/mem_access.h